# Create your views here.

from django.shortcuts import render
from django_tables2 import RequestConfig
from django_tables2 import SingleTableView
from seom.models import Person
from seom.tables import PersonTable


#from django.views.generic.detail import DetailView
#from django.utils import timezone

#def people(request):
#    table = PersonTable(Person.objects.all())
#    RequestConfig(request).configure(table)
#    return render(request, 'seom/people.html', {'table': table})

def people(request):
    table = PersonTable(Person.objects.all())
    RequestConfig(request, paginate={"per_page": 2}).configure(table)
    return render(request, "seom/people.html", {"table": table})

#class PersonList(SingleTableView):
#    model = Person
#    table_class = PersonTable

#def people(request):
#    table = PersonTable(Person.objects.all())
#    RequestConfig(request, paginate={"per_page": 2}).configure(table)
#    return render(request, "seom/people.html", {"table": table})